package com.tom.controller;

import com.tom.commom.R;
import com.tom.service.WebSocketService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.socket.client.WebSocketClient;


@RestController
@AllArgsConstructor
public class WebController {

    private final WebSocketService webSocketService;

    @PostMapping("send")
    public R sendMessage(@RequestBody String msg){
        webSocketService.sendMessage(msg);

        return R.ok();
    }
}
